


<style lang="less">
body {
  background: #f8f8f8;
}
.info {
  font-size: 14px;
  color: #999;
  text-align: center;
  transition: all 1s;
}
.loading {
  // 加载状态
  margin-top: 0;
  margin-bottom: 0;
  height: 0;
  line-height: 0;
  color: #999;
  overflow: hidden;
  transition: all 0.5s;
  &.active {
    height: 40px;
    line-height: 40px;
  }
}
.share {
  // 分享按钮
  background: white;
  color: #666;
  position: fixed;
  bottom: 30px;
  right: 10px;
  width: 40px;
  height: 40px;
  border-radius: 100%;
  padding: 0;
  box-shadow: 1px 1px 10px #333333;
  // color: #3399fe;
  .iconfont {
    font-size: 24px;
    margin-top: -12px;
    animation: Tada 3s ease-in-out 2s infinite;
  }
}
.avator {
  // 头像
  display: flex;
  align-content: center;
  &-img {
    width: 30px;
    height: 30px;
    border-radius: 100%;
    margin-right: 5px;
  }
}
.c-primary {
  color: #3399ff !important;
}
.c-black {
  color: #333 !important;
}
.c-black1 {
  color: #666 !important;
}
.c-black2 {
  color: #999 !important;
}
/*动画*/
@keyframes Tada {
  0% {
    transform: scale(1);
    transform: scale(1);
  }
  10%,
  20% {
    transform: scale(0.9) rotate(-3deg);
    transform: scale(0.9) rotate(-3deg);
  }
  30%,
  50%,
  70%,
  90% {
    transform: scale(1.1) rotate(3deg);
    transform: scale(1.1) rotate(3deg);
  }
  40%,
  60%,
  80% {
    transform: scale(1.1) rotate(-3deg);
    transform: scale(1.1) rotate(-3deg);
  }
  100% {
    transform: scale(1) rotate(0);
    transform: scale(1) rotate(0);
  }
}
.van-tab--active {
  color: #3399ff !important;
}
.van-tabs__line {
  height: 1px !important;
  background: #3399ff !important;
}
</style>

<script>
export default {
  created() {
    // 调用API从本地缓存中获取数据
    /*
     * 平台 api 差异的处理方式:  api 方法统一挂载到 mpvue 名称空间, 平台判断通过 mpvuePlatform 特征字符串
     * 微信：mpvue === wx, mpvuePlatform === 'wx'
     * 头条：mpvue === tt, mpvuePlatform === 'tt'
     * 百度：mpvue === swan, mpvuePlatform === 'swan'
     * 支付宝(蚂蚁)：mpvue === my, mpvuePlatform === 'my'
     */

    let logs;
    if (mpvuePlatform === 'my') {
      logs = mpvue.getStorageSync({ key: 'logs' }).data || [];
      logs.unshift(Date.now());
      mpvue.setStorageSync({
        key: 'logs',
        data: logs
      });
    } else {
      logs = mpvue.getStorageSync('logs') || [];
      logs.unshift(Date.now());
      mpvue.setStorageSync('logs', logs);
    }
  },
  log() {
    console.log(`log at:${Date.now()}`);
  }
};
</script>